<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>钻石投票_投票记录</title>

    <link rel="stylesheet" href="__MCSS__/bass.css"/>
    <link rel="stylesheet" href="__CSS__/font-awesome.css"/>
    <link rel="stylesheet" href="__JS__/layui/css/layui.css"/>
    <link rel="stylesheet" href="__MCSS__/layui-formadd.css"/>
    <link rel="stylesheet" href="__MCSS__/layui-pageadd.css"/>
    <link rel="stylesheet" href="__MCSS__/public.css"/>
    <link rel="stylesheet" href="__MCSS__/layui-add.css"/>
    <link rel="stylesheet" href="__MCSS__/vote_count.css">

</head>
<body>

<div class="vote-count">
    <div class="vote-count-body">
        <!--面包屑-->
        <p class="bread-crumbs-nav"><span class="span1">数据记录</span><i class="fa fa-caret-right"></i><span class="span2">投票记录</span></p>

        <!--内容区-->
        <div class="vote-main">

            <div class="vote-tit">
                <div class="vote-tit-seach">
                    <p><input type="text" placeholder="搜索投票人IP/昵称" value="{$keyword}" class="keywords" /></p>
                    <span class="k-button-seach">搜索</span>
                </div>
                <div class="vote-tit-day">
                    <div class="vote-day-msg {eq name="time" value="1"}vote-day-active{/eq}" data-time="1">全部</div>
                    <div class="vote-day-msg {eq name="time" value="2"}vote-day-active{/eq}" data-time="2">昨日</div>
                    <div class="vote-day-msg {eq name="time" value="3"}vote-day-active{/eq}" data-time="3">今日</div>
                    <div class="vote-day-msg {eq name="time" value="4"}vote-day-active{/eq}" data-time="4">近3日</div>
                    <div class="vote-day-msg {eq name="time" value="5"}vote-day-active{/eq}" data-time="5">近7日</div>
                </div>
                <div class="vote-tit-date">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">日期范围</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" id="vote-date-choose" placeholder="请选择时间段" value="{$timebet}">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="vote-table">
                <div class="vote-table-tit">
                    <ul>
                        <li class="vote-tit-li1">投票活动</li>
                        <li class="vote-tit-li2">选手（编号:/名称）</li>
                        <li class="vote-tit-li3">微信OPENID</li>
                        <li class="vote-tit-li4">IP</li>
                        <li class="vote-tit-li5">时间</li>
                    </ul>
                </div>
                <div class="vote-table-body">
                    {volist name="list" id="vo"}
                        <ul>
                            <li class="vote-tit-li1"><a href="#">{$vo.title}</a></li>
                            <li class="vote-tit-li2"><a href="#"><img src="{$vo.image}" alt="">{$vo.competitor_num}/{$vo.competitor_name}</a></li>
                            <li class="vote-tit-li3">{$vo.openid}</li>
                            <li class="vote-tit-li4">{$vo.ip}</li>
                            <li class="vote-tit-li5">{:date('Y-m-d H:i:s',$vo.create_time)}</li>
                        </ul>
                    {/volist}
                </div>
            </div>
        </div>
        <div class="vote-page"><div id="vote-page-list">{$list|raw}</div></div>
    </div>
</div>
<script src="__JS__/jquery_v3.3.1.js"></script>
<script src="__JS__/layer/layer.js"></script>
<script src="__JS__/layui/layui.js"></script>
<script type="text/javascript">
    // 搜索
    $(document).on('click','.k-button-seach',function () {
        var keyword = $.trim($('.keywords').val());
        if(keyword == ''){
            layer.msg('请输入搜索内容');return false;
        }
        window.location.href="/admin/datalogging/votelist/keyword/"+keyword;
    });
    // 选择日期
    $('.vote-day-msg').click(function(){
        var _this = $(this);
        $('#vote-date-choose').val('');
        var time_type = _this.attr('data-time');
        $('.vote-day-msg').removeClass('vote-day-active');
        _this.addClass('vote-day-active').siblings().removeClass('vote-day-active');
        if(time_type >= 1){
            window.location.href="/admin/datalogging/votelist/time_type/"+time_type;
        }
    });
    //时间日期
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        laydate.render({
            elem: '#vote-date-choose'
            ,range: true
            ,done: function(value){
                if(value == ''){
                    layer.msg('请选择时间');return false;
                }
                window.location.href="/admin/datalogging/votelist/timebet/"+value;
            }
        });
    });

    // //分页设置
    // layui.use('laypage', function(){
    //     var laypage = layui.laypage;
    //     laypage.render({
    //         elem: 'vote-page-list', //注意，这里的 test1 是 ID，不用加 # 号
    //         count:counts, //数据总数，从服务端得到
    //         curr: page, //哪一页被选中
    //         layout: ['count', 'prev', 'page', 'next', 'skip'],
    //         groups:10,//显示多少页
    //         limit:1,//每页显示多少
    //         jump: function(obj, first) {
    //             if(page != obj.curr){
    //                 var keyword = $.trim($('.keywords').val());
    //                 var time_type = $('.vote-day-active').attr('data-time');
    //                 var timebet = $('#vote-date-choose').val();
    //                 window.location.href="/admin/datalogging/votelist?keyword="+keyword+"&time_type="+time_type+"&timebet="+timebet+"&p="+obj.curr;
    //             }
    //         }
    //     });
    // });
    // $(document).on('click','.layui-laypage-btn',function () {
    //     var _this = $(this);
    //     console.log(_this);
    //     console.log(_this.prev());
    // });



</script>
</body>
</html>